<template>
  <div style="margin: 10px;">
    <el-card style="height: 640px;">
      <el-tabs value="category" @tab-click="chooseChart">
        <el-tab-pane label="资产统计" disabled></el-tab-pane>
        <el-tab-pane label="按所属分类" name="category">
        </el-tab-pane>
        <el-tab-pane label="按所属部门" name="department">
        </el-tab-pane>
        <el-tab-pane label="按资产状态" name="status">
        </el-tab-pane>
      </el-tabs>
      <router-view></router-view>
    </el-card>
  </div>
</template>

<script>

export default {
  name: 'AppIndex',
  data () {
    return {
      currentTab: 'category'
    }
  },
  methods: {
    chooseChart (tab) {
      const name = tab.name
      if (this.currentTab === name) {
        return
      }
      this.currentTab = name
      if (name === 'category') {
        // 按分类统计
        this.$router.push('/index/category')
      }
      if (name === 'department') {
        // 按部门统计
        this.$router.push('/index/department')
      }
      if (name === 'status') {
        // 按资产状态统计
        this.$router.push('/index/status')
      }
    }
  }
}
</script>

<style scoped>
</style>
